<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Getting Started - ArduinoUnit Documentation</title>
<link href="styles/styles.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<h1><a href="index.html"><img border="0" src="images/arduinounit.png"/></a> <span class="success">Arduino</span><span class="failure">Unit</span> Documentation</h1>

<h2>Getting Started</h2>
<p>
Create a directory called ArduinoUnit under &lt;arduino installation directory&gt;\hardware\libraries.
</p>
<p>
Copy everything from the src directory to this new directory.
</p>
<p>
Open the Arduino software IDE and create a new, empty sketch (by clicking
File | New or Ctrl+N). Next, import the ArduinoUnit library by clicking Sketch
| Import Library | ArduinoUnit. This will insert the following line of code:
</p>
<code>
#include &lt;ArduinoUnit.h&gt;
</code>
<p>
Copy and paste the following simple unit testing sketch below the
<code>#include</code> line:
</p>
<code>
// Create test suite
TestSuite suite;

void setup() {
}

// Create a test called 'addition' in the test suite
test(addition) {
  assertEquals(3, 1 + 2);
}

void loop() {
  // Run test suite, printing results to the serial port
  suite.run();
}
</code>
</p>
<p>
Make sure that your Arduino is connected to your computer and that you have
correctly configured the Board and Serial Port settings under the Tools menu.
</p>
<p>
Upload the sketch to the Arduino (using the 'Upload to I/O Board' button,
File | Upload to I/O Board or Ctrl+U).
</p>
<p>
Turn on the Serial Monitor (using the 'Serial Monitor' button) and if you've
followed these steps correctly you should see the following output:
</p>
<pre>
Running test suite...
Tests run: 1 Successful: 1 Failed: 0
</pre>

</body>
</html>